<?php


class langmodule {
	function name() { return "Language Module";  }
	function description() { return "Uses to help user navigate language on page";  }
	
	function author() { return "Trung Dang"; }
	
	function hasContent() { return false; }
	function hasSources() { return false; }
	function hasViews()   { return true; }
	
	function supportsWorkflow() { return false; }
	
	function permissions($internal = "") {
		return array();
	}
	
	function show($view,$loc,$title = '') {
        
        global $db;
        global $user,$browser;
        
        
        // determine this user is normal client or administrator
        $google_translate=true;
        if (exponent_users_isLoggedIn() && !exponent_users_isAdmin())
        {
            $google_translate=false;
        }
        
        // get list of language
        $langs = exponent_lang_full();
        if($browser->isMobile()&&$browser->getBrowser()!="iPad")
        {
          $template = new template('langmodule',$view.'_mobile',$loc);  
        }
        else
        {
           $template = new template('langmodule',$view,$loc); 
        }
		

		//$template->assign('textitem',$textitem);
		$template->assign('moduletitle',$title);
		// 4/18/2010: immanuel192 write this code to support google translate
		$url = URL_FULL . substr($_SERVER['REQUEST_URI'],1);
        $template->assign('userlogin',exponent_users_isLoggedIn()?1:0);
        $template->assign('current_path',$url);
        $template->assign('google_translate',$google_translate);
		$template->assign('langs',$langs);
		// end of google translate
		
		$template->register_permissions(array(),$loc);
		$template->output();
	}
}

?>
